<?php defined('SYSPATH') or die('No direct script access.');

class Open extends Track {

	protected $campaign;
	protected $store_id;

	public function __construct($recipient_id = '', $store_id = '', $campaign='', $hashcookie='', $ipRecipient = '')
	{
		parent::__construct();
		$this->event_type = 'open';
		$this->campaign = $campaign;
		$this->hashcookie = $hashcookie;
		$this->store_id = $store_id;
		$this->recipient_id = $recipient_id;
		if($ipRecipient!='') $this->ip = $ipRecipient;
	}

	public function saveFileEvent($childArrayData=array()){
		$data = array(
			'campaign' => $this->campaign,
			'store_id' => $this->store_id,
		);
		parent::saveFileEvent($data);
	}

	public function doTrack($childArrayData=array()){
		$data = array(
			'campaign' => $this->campaign,
			'store_id' => $this->store_id,
		);
		parent::doTrack($data);
	}
}